package com.css.fxfzfxqh.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum SystemBasicDataEnum {

    NAME1(1,"地下管网"),
    NAME2(2,"水厂水池"),
    NAME3(3,"燃气-储气罐"),
    NAME4(4,"桥梁"),
    NAME5(5,"道路"),
    NAME6(6,"变电站"),
    NAME7(7,"架空线路"),
    NAME8(8,"电缆线路"),
    NAME9(9,"室内通信设备"),
    NAME10(10,"电视塔");

    private final Integer code;
    private final String name;


    public static String getByCode(String dataSources) {
        StringBuilder str = new StringBuilder();
        for (String dataSource : dataSources.split(",")) {
            int code = Integer.parseInt(dataSource);
            for (SystemBasicDataEnum value : SystemBasicDataEnum.values()) {
                if(code == value.code){
                    str.append(value.name+"、");
                }
            }
        }
        return str.substring(0, str.length()-1);
    }



}
